<template>
  <div class="electronic-banner">
    <div class="page-header">
      <h1 class="page-title">电子锦旗管理</h1>
      <div class="header-actions">
        <el-button type="success" @click="showCharityDialog = true">
          <i class="fas fa-heart mr-2"></i>爱心转移
        </el-button>
        <el-button type="primary" @click="showCreateDialog = true">
          <i class="fas fa-plus mr-2"></i>创建锦旗
        </el-button>
        <el-button type="primary" @click="refreshData">
          <i class="fas fa-sync-alt mr-2"></i>刷新
        </el-button>
      </div>
    </div>

    <!-- 统计信息 -->
    <div class="stats-section">
      <div class="stat-card total">
        <div class="stat-icon">
          <i class="fas fa-award"></i>
        </div>
        <div class="stat-content">
          <div class="stat-number">{{ stats.totalBanners }}</div>
          <div class="stat-label">总锦旗数</div>
        </div>
      </div>
      <div class="stat-card revenue">
        <div class="stat-icon">
          <i class="fas fa-yen-sign"></i>
        </div>
        <div class="stat-content">
          <div class="stat-number">{{ formatMoney(stats.totalRevenue) }}</div>
          <div class="stat-label">总收入</div>
        </div>
      </div>
      <div class="stat-card charity">
        <div class="stat-icon">
          <i class="fas fa-heart"></i>
        </div>
        <div class="stat-content">
          <div class="stat-number">{{ stats.charityBanners }}</div>
          <div class="stat-label">爱心转移</div>
        </div>
      </div>
      <div class="stat-card points">
        <div class="stat-icon">
          <i class="fas fa-coins"></i>
        </div>
        <div class="stat-content">
          <div class="stat-number">{{ stats.totalPoints }}</div>
          <div class="stat-label">发放积分</div>
        </div>
      </div>
    </div>

    <!-- 筛选区域 -->
    <div class="filter-section">
      <div class="filter-row">
        <el-select v-model="typeFilter" placeholder="锦旗类型" clearable>
          <el-option label="全部" value=""></el-option>
          <el-option label="普通锦旗" value="normal"></el-option>
          <el-option label="爱心转移" value="charity"></el-option>
        </el-select>
        <el-date-picker
          v-model="dateRange"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          format="YYYY-MM-DD"
          value-format="YYYY-MM-DD"
        />
        <el-input
          v-model="searchQuery"
          placeholder="搜索购买者或标题"
          class="search-input"
          clearable
        >
          <template #prefix>
            <i class="fas fa-search"></i>
          </template>
        </el-input>
      </div>
    </div>

    <!-- 锦旗列表 -->
    <div class="banners-section">
      <div class="section-header">
        <h2 class="section-title">锦旗列表</h2>
        <div class="view-controls">
          <el-radio-group v-model="viewMode" size="small">
            <el-radio-button label="grid">网格视图</el-radio-button>
            <el-radio-button label="list">列表视图</el-radio-button>
          </el-radio-group>
        </div>
      </div>

      <!-- 网格视图 -->
      <div v-if="viewMode === 'grid'" class="grid-view">
        <div class="banners-grid">
          <div 
            v-for="banner in filteredBanners" 
            :key="banner.id"
            class="banner-card"
            :class="{ 'charity-card': banner.isCharity }"
          >
            <div class="banner-header">
              <div class="banner-info">
                <h4>{{ banner.title }}</h4>
                <p class="banner-meta">
                  <span>购买者：{{ banner.buyer }}</span>
                  <span v-if="banner.recipient" class="ml-4">
                    <i class="fas fa-heart text-red-500 mr-1"></i>
                    受助人：{{ banner.recipient }}
                  </span>
                </p>
              </div>
              <div class="banner-amount">
                <span class="amount">￥{{ banner.amount }}</span>
                <span class="points">+{{ banner.points }}积分</span>
              </div>
            </div>
            
            <div class="banner-content">
              <div class="banner-message">
                <i class="fas fa-quote-left"></i>
                <p>{{ banner.message }}</p>
                <i class="fas fa-quote-right"></i>
              </div>
            </div>
            
            <div class="banner-footer">
              <div class="banner-stats">
                <span class="date">{{ banner.createdAt }}</span>
                <el-tag v-if="banner.isCharity" type="warning" size="small">
                  <i class="fas fa-heart mr-1"></i>爱心转移
                </el-tag>
                <el-tag v-if="banner.isPublic" type="success" size="small">
                  公开展示
                </el-tag>
              </div>
              <div class="banner-actions">
                <el-button size="small" type="primary" @click="viewBanner(banner)">
                  <i class="fas fa-eye mr-1"></i>查看
                </el-button>
                <el-button 
                  v-if="!banner.isCharity" 
                  size="small" 
                  type="success" 
                  @click="convertToCharity(banner)"
                >
                  <i class="fas fa-heart mr-1"></i>转爱心
                </el-button>
                <el-button size="small" type="danger" @click="deleteBanner(banner)">
                  <i class="fas fa-trash mr-1"></i>删除
                </el-button>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 列表视图 -->
      <div v-else class="list-view">
        <el-table :data="filteredBanners" style="width: 100%">
          <el-table-column prop="id" label="ID" width="60"></el-table-column>
          <el-table-column prop="title" label="标题" min-width="200"></el-table-column>
          <el-table-column prop="buyer" label="购买者" width="100"></el-table-column>
          <el-table-column prop="recipient" label="受助人" width="100">
            <template #default="{ row }">
              <span v-if="row.recipient">
                <i class="fas fa-heart text-red-500 mr-1"></i>
                {{ row.recipient }}
              </span>
              <span v-else class="text-gray-400">无</span>
            </template>
          </el-table-column>
          <el-table-column prop="amount" label="金额" width="100" align="center">
            <template #default="{ row }">
              <span class="text-green-600 font-semibold">￥{{ row.amount }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="points" label="积分" width="80" align="center">
            <template #default="{ row }">
              <span class="text-blue-600 font-semibold">+{{ row.points }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="isCharity" label="类型" width="100" align="center">
            <template #default="{ row }">
              <el-tag :type="row.isCharity ? 'warning' : 'primary'" size="small">
                {{ row.isCharity ? '爱心转移' : '普通锦旗' }}
              </el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="createdAt" label="创建时间" width="120"></el-table-column>
          <el-table-column label="操作" width="200" align="center">
            <template #default="{ row }">
              <el-button size="small" type="primary" @click="viewBanner(row)">
                <i class="fas fa-eye mr-1"></i>查看
              </el-button>
              <el-button 
                v-if="!row.isCharity" 
                size="small" 
                type="success" 
                @click="convertToCharity(row)"
              >
                <i class="fas fa-heart mr-1"></i>转爱心
              </el-button>
              <el-button size="small" type="danger" @click="deleteBanner(row)">
                <i class="fas fa-trash mr-1"></i>删除
              </el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>

      <!-- 分页 -->
      <div class="pagination-section">
        <el-pagination
          v-model:current-page="currentPage"
          v-model:page-size="pageSize"
          :page-sizes="[12, 24, 48, 96]"
          layout="total, sizes, prev, pager, next, jumper"
          :total="totalBanners"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
        />
      </div>
    </div>

    <!-- 创建锦旗对话框 -->
    <el-dialog v-model="showCreateDialog" title="创建电子锦旗" width="600px">
      <el-form :model="newBanner" :rules="bannerRules" ref="bannerForm" label-width="100px">
        <el-form-item label="锦旗标题" prop="title">
          <el-input v-model="newBanner.title" placeholder="请输入锦旗标题"></el-input>
        </el-form-item>
        <el-form-item label="购买者" prop="buyer">
          <el-input v-model="newBanner.buyer" placeholder="请输入购买者姓名"></el-input>
        </el-form-item>
        <el-form-item label="感谢内容" prop="message">
          <el-input 
            v-model="newBanner.message" 
            type="textarea" 
            rows="4"
            placeholder="请输入感谢内容"
            maxlength="200"
            show-word-limit
          ></el-input>
        </el-form-item>
        <el-form-item label="付费金额">
          <el-input-number 
            v-model="newBanner.amount" 
            :min="200" 
            :step="50"
            controls-position="right"
          />
          <span class="ml-2">元（固定200元，获得40积分）</span>
        </el-form-item>
        <el-form-item label="公开展示">
          <el-switch v-model="newBanner.isPublic"></el-switch>
          <span class="ml-2 text-gray-500">是否在前台公开展示</span>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="showCreateDialog = false">取消</el-button>
          <el-button type="primary" @click="handleCreateBanner">创建锦旗</el-button>
        </span>
      </template>
    </el-dialog>

    <!-- 爱心转移对话框 -->
    <el-dialog v-model="showCharityDialog" title="爱心转移" width="600px">
      <div class="charity-section">
        <el-alert
          title="爱心转移说明"
          type="info"
          :closable="false"
          show-icon
        >
          <template #default>
            <p>爱心转移功能允许您将电子锦旗绑定给需要帮助的人，传递温暖和关爱。</p>
            <ul class="mt-2">
              <li>选择现有锦旗进行爱心转移</li>
              <li>指定受助人信息</li>
              <li>系统会记录爱心转移记录</li>
            </ul>
          </template>
        </el-alert>
        
        <el-form :model="charityForm" label-width="100px" class="mt-4">
          <el-form-item label="选择锦旗" prop="bannerId">
            <el-select v-model="charityForm.bannerId" placeholder="选择要转移的锦旗" style="width: 100%">
              <el-option 
                v-for="banner in availableBanners" 
                :key="banner.id"
                :label="`${banner.title} - ${banner.buyer}`"
                :value="banner.id"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="受助人" prop="recipient">
            <el-input v-model="charityForm.recipient" placeholder="请输入受助人姓名或描述"></el-input>
          </el-form-item>
          <el-form-item label="转移说明" prop="description">
            <el-input 
              v-model="charityForm.description" 
              type="textarea" 
              rows="3"
              placeholder="请输入爱心转移的说明"
            ></el-input>
          </el-form-item>
        </el-form>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="showCharityDialog = false">取消</el-button>
          <el-button type="success" @click="handleCharityTransfer">
            <i class="fas fa-heart mr-1"></i>确认转移
          </el-button>
        </span>
      </template>
    </el-dialog>

    <!-- 查看锦旗对话框 -->
    <el-dialog v-model="showViewDialog" title="查看锦旗详情" width="500px">
      <div v-if="currentBanner" class="banner-detail">
        <div class="detail-header">
          <h3>{{ currentBanner.title }}</h3>
          <div class="detail-tags">
            <el-tag v-if="currentBanner.isCharity" type="warning" size="small">
              <i class="fas fa-heart mr-1"></i>爱心转移
            </el-tag>
            <el-tag v-if="currentBanner.isPublic" type="success" size="small">
              公开展示
            </el-tag>
          </div>
        </div>
        
        <div class="detail-info">
          <div class="info-item">
            <label>购买者：</label>
            <span>{{ currentBanner.buyer }}</span>
          </div>
          <div v-if="currentBanner.recipient" class="info-item">
            <label>受助人：</label>
            <span class="text-red-500">
              <i class="fas fa-heart mr-1"></i>
              {{ currentBanner.recipient }}
            </span>
          </div>
          <div class="info-item">
            <label>付费金额：</label>
            <span class="text-green-600 font-semibold">￥{{ currentBanner.amount }}</span>
          </div>
          <div class="info-item">
            <label>获得积分：</label>
            <span class="text-blue-600 font-semibold">+{{ currentBanner.points }}积分</span>
          </div>
          <div class="info-item">
            <label>创建时间：</label>
            <span>{{ currentBanner.createdAt }}</span>
          </div>
        </div>
        
        <div class="detail-message">
          <label>感谢内容：</label>
          <div class="message-content">
            <i class="fas fa-quote-left"></i>
            <p>{{ currentBanner.message }}</p>
            <i class="fas fa-quote-right"></i>
          </div>
        </div>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="showViewDialog = false">关闭</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script>
import { ref, reactive, computed } from 'vue'

export default {
  name: 'ElectronicBanner',
  setup() {
    const typeFilter = ref('')
    const dateRange = ref([])
    const searchQuery = ref('')
    const viewMode = ref('grid')
    const currentPage = ref(1)
    const pageSize = ref(12)
    const showCreateDialog = ref(false)
    const showCharityDialog = ref(false)
    const showViewDialog = ref(false)
    const currentBanner = ref(null)
    
    const stats = reactive({
      totalBanners: 156,
      totalRevenue: 31200,
      charityBanners: 45,
      totalPoints: 1560
    })
    
    const banners = ref([
      {
        id: 1,
        title: '感谢张律师专业服务',
        buyer: '李先生',
        recipient: null,
        amount: 200,
        points: 40,
        message: '张律师在我的交通事故案件中表现非常专业，帮我争取到了合理的赔偿，非常感谢！',
        createdAt: '2024-02-15',
        isCharity: false,
        isPublic: true
      },
      {
        id: 2,
        title: '爱心锦旗 - 帮助困难家庭',
        buyer: '王女士',
        recipient: '张大爷',
        amount: 200,
        points: 40,
        message: '希望这份心意能帮助到需要帮助的人，传递温暖和关爱。',
        createdAt: '2024-02-14',
        isCharity: true,
        isPublic: true
      },
      {
        id: 3,
        title: '专业交通事故处理',
        buyer: '陈先生',
        recipient: null,
        amount: 200,
        points: 40,
        message: '律师团队处理我的案件非常用心，从伤残鉴定到理赔都很专业。',
        createdAt: '2024-02-13',
        isCharity: false,
        isPublic: false
      },
      {
        id: 4,
        title: '爱心传递 - 资助学生',
        buyer: '赵女士',
        recipient: '小明同学',
        amount: 200,
        points: 40,
        message: '希望能为贫困学生提供一些帮助，让爱心传递下去。',
        createdAt: '2024-02-12',
        isCharity: true,
        isPublic: true
      }
    ])
    
    const newBanner = reactive({
      title: '',
      buyer: '',
      message: '',
      amount: 200,
      isPublic: true
    })
    
    const charityForm = reactive({
      bannerId: null,
      recipient: '',
      description: ''
    })
    
    const bannerRules = {
      title: [{ required: true, message: '请输入锦旗标题', trigger: 'blur' }],
      buyer: [{ required: true, message: '请输入购买者姓名', trigger: 'blur' }],
      message: [{ required: true, message: '请输入感谢内容', trigger: 'blur' }]
    }
    
    const filteredBanners = computed(() => {
      return banners.value.filter(banner => {
        const matchesType = !typeFilter.value || 
          (typeFilter.value === 'charity' && banner.isCharity) ||
          (typeFilter.value === 'normal' && !banner.isCharity)
        
        const matchesSearch = !searchQuery.value || 
          banner.title.includes(searchQuery.value) ||
          banner.buyer.includes(searchQuery.value)
        
        // 简单的日期筛选逻辑
        const matchesDate = !dateRange.value || dateRange.value.length === 0
        
        return matchesType && matchesSearch && matchesDate
      })
    })
    
    const availableBanners = computed(() => {
      return banners.value.filter(banner => !banner.isCharity)
    })
    
    const totalBanners = computed(() => filteredBanners.value.length)
    
    const formatMoney = (amount) => {
      return '￥' + amount.toLocaleString()
    }
    
    const handleSizeChange = (size) => {
      pageSize.value = size
      currentPage.value = 1
    }
    
    const handleCurrentChange = (page) => {
      currentPage.value = page
    }
    
    const refreshData = () => {
      ElMessage.success('数据已刷新')
    }
    
    const viewBanner = (banner) => {
      currentBanner.value = banner
      showViewDialog.value = true
    }
    
    const convertToCharity = (banner) => {
      ElMessageBox.prompt('请输入受助人信息', '爱心转移', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        inputPlaceholder: '请输入受助人姓名或描述'
      }).then(({ value }) => {
        if (value) {
          banner.isCharity = true
          banner.recipient = value
          ElMessage.success('爱心转移成功')
        }
      }).catch(() => {
        ElMessage.info('已取消转移')
      })
    }
    
    const deleteBanner = (banner) => {
      ElMessageBox.confirm(
        `确定要删除锦旗"${banner.title}"吗？`,
        '删除确认',
        {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning',
        }
      ).then(() => {
        const index = banners.value.indexOf(banner)
        if (index > -1) {
          banners.value.splice(index, 1)
          ElMessage.success('删除成功')
        }
      }).catch(() => {
        ElMessage.info('已取消删除')
      })
    }
    
    const handleCreateBanner = () => {
      if (!newBanner.title || !newBanner.buyer || !newBanner.message) {
        ElMessage.warning('请填写完整信息')
        return
      }
      
      const banner = {
        id: banners.value.length + 1,
        title: newBanner.title,
        buyer: newBanner.buyer,
        recipient: null,
        amount: 200,
        points: 40,
        message: newBanner.message,
        createdAt: new Date().toISOString().split('T')[0],
        isCharity: false,
        isPublic: newBanner.isPublic
      }
      
      banners.value.unshift(banner)
      
      // 重置表单
      Object.assign(newBanner, {
        title: '',
        buyer: '',
        message: '',
        amount: 200,
        isPublic: true
      })
      
      showCreateDialog.value = false
      ElMessage.success('创建成功')
    }
    
    const handleCharityTransfer = () => {
      if (!charityForm.bannerId || !charityForm.recipient) {
        ElMessage.warning('请填写完整信息')
        return
      }
      
      const banner = banners.value.find(b => b.id === charityForm.bannerId)
      if (banner) {
        banner.isCharity = true
        banner.recipient = charityForm.recipient
        
        // 重置表单
        Object.assign(charityForm, {
          bannerId: null,
          recipient: '',
          description: ''
        })
        
        showCharityDialog.value = false
        ElMessage.success('爱心转移成功')
      }
    }
    
    return {
      typeFilter,
      dateRange,
      searchQuery,
      viewMode,
      currentPage,
      pageSize,
      showCreateDialog,
      showCharityDialog,
      showViewDialog,
      currentBanner,
      stats,
      banners,
      newBanner,
      charityForm,
      bannerRules,
      filteredBanners,
      availableBanners,
      totalBanners,
      formatMoney,
      handleSizeChange,
      handleCurrentChange,
      refreshData,
      viewBanner,
      convertToCharity,
      deleteBanner,
      handleCreateBanner,
      handleCharityTransfer
    }
  }
}
</script>

<style scoped>
.electronic-banner {
  padding: 24px;
  background-color: #f5f5f5;
  min-height: 100vh;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-title {
  font-size: 28px;
  font-weight: bold;
  color: #1f2937;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 4px solid #e5e7eb;
}

.stat-card.total {
  border-left-color: #3b82f6;
}

.stat-card.revenue {
  border-left-color: #10b981;
}

.stat-card.charity {
  border-left-color: #ef4444;
}

.stat-card.points {
  border-left-color: #f59e0b;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #6b7280;
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 24px;
  font-weight: bold;
  color: #1f2937;
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

.filter-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.search-input {
  flex: 1;
  max-width: 300px;
}

.banners-section {
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: bold;
  color: #1f2937;
  margin: 0;
}

.banners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.banner-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.banner-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #8b5cf6);
}

.banner-card.charity-card::before {
  background: linear-gradient(90deg, #ef4444, #f97316, #ec4899);
}

.banner-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.banner-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.banner-info h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: bold;
  color: #1f2937;
}

.banner-meta {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

.banner-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.amount {
  font-size: 18px;
  font-weight: bold;
  color: #ef4444;
}

.points {
  font-size: 14px;
  color: #f59e0b;
  font-weight: 500;
}

.banner-content {
  margin-bottom: 16px;
}

.banner-message {
  position: relative;
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  border-left: 3px solid #f59e0b;
}

.banner-message i {
  color: #d1d5db;
  font-size: 12px;
}

.banner-message .fa-quote-left {
  position: absolute;
  top: 8px;
  left: 8px;
}

.banner-message .fa-quote-right {
  position: absolute;
  bottom: 8px;
  right: 8px;
}

.banner-message p {
  margin: 0;
  color: #374151;
  line-height: 1.6;
  font-size: 14px;
  padding: 0 12px;
}

.banner-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.banner-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.date {
  font-size: 12px;
  color: #9ca3af;
}

.banner-actions {
  display: flex;
  gap: 8px;
}

.pagination-section {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* 对话框样式 */
.charity-section ul {
  margin: 8px 0 0 20px;
  padding: 0;
}

.charity-section li {
  margin-bottom: 4px;
  font-size: 14px;
  color: #6b7280;
}

.banner-detail {
  padding: 16px 0;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.detail-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 18px;
}

.detail-tags {
  display: flex;
  gap: 8px;
}

.detail-info {
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.info-item label {
  width: 80px;
  color: #6b7280;
  font-size: 14px;
  flex-shrink: 0;
}

.info-item span {
  color: #1f2937;
  font-size: 14px;
}

.detail-message label {
  display: block;
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 8px;
}

.message-content {
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  border-left: 3px solid #f59e0b;
  position: relative;
}

.message-content i {
  color: #d1d5db;
  font-size: 12px;
}

.message-content .fa-quote-left {
  position: absolute;
  top: 8px;
  left: 8px;
}

.message-content .fa-quote-right {
  position: absolute;
  bottom: 8px;
  right: 8px;
}

.message-content p {
  margin: 0;
  color: #374151;
  line-height: 1.6;
  font-size: 14px;
  padding: 0 12px;
}

@media (max-width: 768px) {
  .banners-grid {
    grid-template-columns: 1fr;
  }
  
  .banner-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .banner-amount {
    align-items: flex-start;
  }
  
  .filter-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .search-input {
    max-width: 100%;
  }
}
</style>

